package exception;

public class TryCatchDemo {
    public static void main(String[] args) {
        System.out.println("程序开始");

        try{
           // String str = null;
            //  System.out.println(str.length());

            //String line1="";
            //System.out.println(line1.charAt(0));

            String line2="abc";
            System.out.println(Integer.parseInt(line2));

        }catch (NullPointerException c){
            System.out.println("伞兵一号卢本伟准备就绪！");
            System.out.println("出现空指针，并解决完毕");

        }catch (StringIndexOutOfBoundsException c){
            System.out.println("下标越界，别特么马帅帅了");
        }catch (Exception c){
            System.out.println("出错了，没解决，你你小子");
        }
        System.out.println("程序结束！");

    }
}
